﻿@model Project_1.Models.Message
@{
    ViewBag.Title = "Send Message";
}
<h2>Send Message</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@Html.ValidationSummary(true, "Sending was unsuccessful. Please correct the errors and try again.")

@using (Html.BeginForm())
{
    <div>
        <fieldset>
            <legend>Message Information</legend>
            <div class="editor-label">
                @Html.LabelFor(m => m.Sender)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Sender, new { @Value = Session["Username"] , @Enabled = false})
                @Html.ValidationMessageFor(m => m.Sender)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.Receiver)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Receiver)
                @ViewBag.Error
                @Html.ValidationMessageFor(m => m.Receiver)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.Title)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Title)
                @Html.ValidationMessageFor(m => m.Title)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.Content)
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.Content, new { Width = "350px;", Height = "150px;" })
                @Html.ValidationMessageFor(m => m.Content)
            </div>
            <p>
                <input type="submit" value="Send" />
            </p>
        </fieldset>
    </div>
}